home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15141 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  2.2 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news text default
99% file C source text default
98% file C source, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 63 69 | 73 75 32 2e 6a 73 63 2e |Path: ci|su2.jsc.|
|00000010| 6e 61 73 61 2e 67 6f 76 | 21 75 73 65 6e 65 74 0a |nasa.gov|!usenet.|
|00000020| 46 72 6f 6d 3a 20 52 6f | 67 65 72 20 4d 69 74 63 |From: Ro|ger Mitc|
|00000030| 68 65 6c 6c 20 3c 72 6d | 69 74 63 68 65 6c 6c 40 |hell <rm|itchell@|
|00000040| 67 68 67 63 6f 72 70 2e | 63 6f 6d 3e 0a 4e 65 77 |ghgcorp.|com>.New|
|00000050| 73 67 72 6f 75 70 73 3a | 20 63 6f 6d 70 2e 6c 61 |sgroups:| comp.la|
|00000060| 6e 67 2e 63 2c 63 6f 6d | 70 2e 6c 61 6e 67 2e 63 |ng.c,com|p.lang.c|
|00000070| 2b 2b 0a 53 75 62 6a 65 | 63 74 3a 20 52 65 3a 20 |++.Subje|ct: Re: |
|00000080| 48 20 45 20 4c 20 50 0a | 44 61 74 65 3a 20 33 20 |H E L P.|Date: 3 |
|00000090| 41 70 72 20 31 39 39 36 | 20 31 37 3a 34 34 3a 32 |Apr 1996| 17:44:2|
|000000a0| 30 20 47 4d 54 0a 4f 72 | 67 61 6e 69 7a 61 74 69 |0 GMT.Or|ganizati|
|000000b0| 6f 6e 3a 20 4e 41 53 41 | 20 54 65 6c 65 76 69 73 |on: NASA| Televis|
|000000c0| 69 6f 6e 20 53 75 70 70 | 6f 72 74 20 53 65 72 76 |ion Supp|ort Serv|
|000000d0| 69 63 65 73 20 43 6f 6e | 74 72 61 63 74 6f 72 0a |ices Con|tractor.|
|000000e0| 4d 65 73 73 61 67 65 2d | 49 44 3a 20 3c 34 6a 75 |Message-|ID: <4ju|
|000000f0| 64 64 6b 24 69 62 6e 40 | 63 69 73 75 32 2e 6a 73 |ddk$ibn@|cisu2.js|
|00000100| 63 2e 6e 61 73 61 2e 67 | 6f 76 3e 0a 52 65 66 65 |c.nasa.g|ov>.Refe|
|00000110| 72 65 6e 63 65 73 3a 20 | 3c 4e 2e 30 34 30 32 39 |rences: |<N.04029|
|00000120| 36 2e 30 31 33 30 34 37 | 2e 31 38 40 44 79 6e 61 |6.013047|.18@Dyna|
|00000130| 6d 69 63 50 50 50 2d 31 | 38 35 2e 48 49 50 2e 43 |micPPP-1|85.HIP.C|
|00000140| 41 4d 2e 4f 52 47 3e 0a | 4e 4e 54 50 2d 50 6f 73 |AM.ORG>.|NNTP-Pos|
|00000150| 74 69 6e 67 2d 48 6f 73 | 74 3a 20 31 33 39 2e 31 |ting-Hos|t: 139.1|
|00000160| 36 39 2e 32 39 2e 34 39 | 0a 4d 69 6d 65 2d 56 65 |69.29.49|.Mime-Ve|
|00000170| 72 73 69 6f 6e 3a 20 31 | 2e 30 0a 43 6f 6e 74 65 |rsion: 1|.0.Conte|
|00000180| 6e 74 2d 54 79 70 65 3a | 20 74 65 78 74 2f 70 6c |nt-Type:| text/pl|
|00000190| 61 69 6e 3b 20 63 68 61 | 72 73 65 74 3d 75 73 2d |ain; cha|rset=us-|
|000001a0| 61 73 63 69 69 0a 43 6f | 6e 74 65 6e 74 2d 54 72 |ascii.Co|ntent-Tr|
|000001b0| 61 6e 73 66 65 72 2d 45 | 6e 63 6f 64 69 6e 67 3a |ansfer-E|ncoding:|
|000001c0| 20 37 62 69 74 0a 58 2d | 4d 61 69 6c 65 72 3a 20 | 7bit.X-|Mailer: |
|000001d0| 4d 6f 7a 69 6c 6c 61 20 | 31 2e 31 4e 20 28 57 69 |Mozilla |1.1N (Wi|
|000001e0| 6e 64 6f 77 73 3b 20 49 | 3b 20 33 32 62 69 74 29 |ndows; I|; 32bit)|
|000001f0| 0a 54 6f 3a 20 72 61 6d | 72 6f 64 40 63 61 6d 2e |.To: ram|rod@cam.|
|00000200| 6f 72 67 0a 0a 72 61 6d | 72 6f 64 40 63 61 6d 2e |org..ram|rod@cam.|
|00000210| 6f 72 67 20 77 72 6f 74 | 65 3a 0a 3e 43 6f 75 6c |org wrot|e:.>Coul|
|00000220| 64 20 61 6e 79 6f 6e 65 | 20 70 6c 65 61 73 65 20 |d anyone| please |
|00000230| 74 65 6c 6c 20 6d 65 20 | 68 6f 77 20 74 6f 20 77 |tell me |how to w|
|00000240| 72 69 74 65 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |rite the| followi|
|00000250| 6e 67 20 70 72 6f 67 72 | 61 6d 2e 0a 3e 55 73 69 |ng progr|am..>Usi|
|00000260| 6e 67 20 6e 65 73 74 65 | 64 20 6c 6f 6f 70 69 6e |ng neste|d loopin|
|00000270| 67 2c 20 74 68 65 20 6f | 75 74 70 75 74 20 69 73 |g, the o|utput is|
|00000280| 20 73 75 70 70 6f 73 65 | 64 20 74 6f 20 6c 6f 6f | suppose|d to loo|
|00000290| 6b 20 6c 69 6b 65 20 74 | 68 69 73 2e 0a 3e 0a 3e |k like t|his..>.>|
|000002a0| 50 6c 65 61 73 65 20 65 | 6e 74 65 72 20 79 6f 75 |Please e|nter you|
|000002b0| 72 20 61 67 65 20 69 6e | 20 79 65 61 72 73 20 28 |r age in| years (|
|000002c0| 30 20 74 6f 20 65 6e 64 | 20 74 68 65 20 70 72 6f |0 to end| the pro|
|000002d0| 67 72 61 6d 29 3a 20 31 | 30 0a 3e 48 61 70 70 79 |gram): 1|0.>Happy|
|000002e0| 20 42 69 72 74 68 64 61 | 79 20 54 6f 20 59 6f 75 | Birthda|y To You|
|000002f0| 0a 3e 59 6f 75 20 61 72 | 65 20 31 30 20 59 65 61 |.>You ar|e 10 Yea|
|00000300| 72 73 20 4f 6c 64 0a 3e | 0a 3e 5c 78 30 31 5c 78 |rs Old.>|.>\x01\x|
|00000310| 30 31 5c 78 30 31 5c 78 | 30 31 5c 78 30 31 5c 78 |01\x01\x|01\x01\x|
|00000320| 30 31 5c 78 30 5c 78 30 | 31 5c 78 30 31 5c 78 30 |01\x0\x0|1\x01\x0|
|00000330| 31 28 74 65 6e 20 68 61 | 70 70 79 20 66 61 63 65 |1(ten ha|ppy face|
|00000340| 73 29 0a 3e 0a 3e 54 68 | 65 20 70 61 72 74 20 74 |s).>.>Th|e part t|
|00000350| 68 61 74 20 49 20 61 6d | 20 68 61 76 69 6e 67 20 |hat I am| having |
|00000360| 61 20 68 61 72 64 20 74 | 69 6d 65 20 77 69 74 68 |a hard t|ime with|
|00000370| 20 69 73 20 74 68 65 20 | 70 61 72 74 20 74 68 61 | is the |part tha|
|00000380| 74 0a 3e 77 68 61 74 65 | 76 65 72 20 6e 75 6d 62 |t.>whate|ver numb|
|00000390| 65 72 20 49 20 65 6e 74 | 65 72 20 66 6f 72 20 74 |er I ent|er for t|
|000003a0| 68 65 20 61 67 65 2c 20 | 49 27 6d 20 73 75 70 70 |he age, |I'm supp|
|000003b0| 6f 73 65 64 20 74 6f 20 | 67 65 74 20 74 68 65 20 |osed to |get the |
|000003c0| 73 61 6d 65 20 6e 75 6d | 62 65 72 0a 3e 6f 66 20 |same num|ber.>of |
|000003d0| 68 61 70 70 79 20 66 61 | 63 65 73 2c 20 61 75 74 |happy fa|ces, aut|
|000003e0| 6f 6d 61 74 69 63 61 6c | 6c 79 2e 20 20 46 6f 72 |omatical|ly. For|
|000003f0| 20 65 78 61 6d 70 6c 65 | 20 49 66 20 49 20 73 61 | example| If I sa|
|00000400| 79 20 49 20 61 6d 20 34 | 35 20 79 65 61 72 73 20 |y I am 4|5 years |
|00000410| 6f 6c 64 2c 0a 3e 74 68 | 65 6e 20 74 68 65 20 70 |old,.>th|en the p|
|00000420| 72 6f 67 72 61 6d 20 73 | 68 6f 75 6c 64 20 73 68 |rogram s|hould sh|
|00000430| 6f 77 20 34 35 20 68 61 | 70 70 79 20 66 61 63 65 |ow 45 ha|ppy face|
|00000440| 73 2e 0a 3e 0a 3e 0a 3e | 0a 0a 53 69 6d 70 6c 65 |s..>.>.>|..Simple|
|00000450| 2e 0a 0a 23 69 6e 63 6c | 75 64 65 20 3c 73 74 64 |...#incl|ude <std|
|00000460| 69 6f 2e 68 3e 20 20 20 | 20 2f 2f 20 66 6f 72 20 |io.h> | // for |
|00000470| 74 68 65 20 70 72 69 6e | 74 66 28 29 20 61 6e 64 |the prin|tf() and|
|00000480| 20 73 63 61 6e 66 28 29 | 20 66 75 6e 63 74 69 6f | scanf()| functio|
|00000490| 6e 73 0a 23 69 6e 63 6c | 75 64 65 20 3c 73 74 64 |ns.#incl|ude <std|
|000004a0| 6c 69 62 2e 68 3e 20 20 | 20 2f 2f 20 66 6f 72 20 |lib.h> | // for |
|000004b0| 74 68 65 20 65 78 69 74 | 28 29 20 66 75 6e 63 74 |the exit|() funct|
|000004c0| 69 6f 6e 0a 0a 76 6f 69 | 64 20 6d 61 69 6e 28 76 |ion..voi|d main(v|
|000004d0| 6f 69 64 29 0a 7b 0a 20 | 20 69 6e 74 20 58 2c 20 |oid).{. | int X, |
|000004e0| 41 67 65 3b 0a 0a 20 20 | 77 68 69 6c 65 28 31 29 |Age;.. |while(1)|
|000004f0| 20 20 2f 2f 20 65 78 65 | 63 75 74 65 20 66 6f 72 | // exe|cute for|
|00000500| 65 76 65 72 20 28 65 78 | 63 65 70 74 20 66 6f 72 |ever (ex|cept for|
|00000510| 20 74 68 65 20 65 78 69 | 74 20 66 75 6e 63 74 69 | the exi|t functi|
|00000520| 6f 6e 20 62 65 6c 6f 77 | 29 0a 20 20 7b 0a 20 20 |on below|). {. |
|00000530| 20 20 70 72 69 6e 74 66 | 28 22 50 6c 65 61 73 65 | printf|("Please|
|00000540| 20 65 6e 74 65 72 20 79 | 6f 75 72 20 61 67 65 20 | enter y|our age |
|00000550| 69 6e 20 79 65 61 72 73 | 20 28 30 20 74 6f 20 65 |in years| (0 to e|
|00000560| 6e 64 20 74 68 65 20 70 | 72 6f 67 72 61 6d 29 3a |nd the p|rogram):|
|00000570| 20 20 22 29 3b 0a 0a 20 | 20 20 20 73 63 61 6e 66 | ");.. | scanf|
|00000580| 28 22 25 64 22 2c 20 26 | 41 67 65 29 3b 20 20 2f |("%d", &|Age); /|
|00000590| 2f 20 66 6f 72 6d 61 74 | 74 65 64 20 72 65 61 64 |/ format|ted read|
|000005a0| 20 66 72 6f 6d 20 73 74 | 64 69 6f 20 28 74 68 65 | from st|dio (the|
|000005b0| 20 63 6f 6e 73 6f 6c 65 | 29 0a 0a 20 20 20 20 70 | console|).. p|
|000005c0| 72 69 6e 74 66 28 22 5c | 6e 5c 72 5c 6e 5c 72 22 |rintf("\|n\r\n\r"|
|000005d0| 29 3b 20 2f 2f 20 74 68 | 69 73 20 6a 75 73 74 20 |); // th|is just |
|000005e0| 67 69 76 65 73 20 79 6f | 75 20 74 77 6f 20 62 6c |gives yo|u two bl|
|000005f0| 61 6e 6b 20 6c 69 6e 65 | 73 0a 0a 20 20 20 20 69 |ank line|s.. i|
|00000600| 66 28 41 67 65 29 20 20 | 2f 2f 20 69 66 20 74 68 |f(Age) |// if th|
|00000610| 65 20 75 73 65 20 65 6e | 74 65 72 65 64 20 61 6e |e use en|tered an|
|00000620| 79 20 6e 75 6d 62 65 72 | 20 6f 74 68 65 72 20 74 |y number| other t|
|00000630| 68 61 6e 20 30 2c 20 74 | 68 69 73 20 77 69 6c 6c |han 0, t|his will|
|00000640| 20 65 76 61 6c 75 61 74 | 65 20 74 72 75 65 0a 20 | evaluat|e true. |
|00000650| 20 20 20 7b 0a 20 20 20 | 20 20 20 2f 2f 20 74 68 | {. | // th|
|00000660| 69 73 20 77 69 6c 6c 20 | 70 72 69 6e 74 20 74 68 |is will |print th|
|00000670| 65 20 74 77 6f 20 6c 69 | 6e 65 73 20 77 69 74 68 |e two li|nes with|
|00000680| 20 74 68 65 20 61 67 65 | 20 65 6e 74 65 72 65 64 | the age| entered|
|00000690| 0a 0a 20 20 20 20 20 20 | 70 72 69 6e 74 66 28 22 |.. |printf("|
|000006a0| 48 61 70 70 79 20 42 69 | 72 74 68 64 61 79 20 54 |Happy Bi|rthday T|
|000006b0| 6f 20 59 6f 75 5c 6e 5c | 72 59 6f 75 20 61 72 65 |o You\n\|rYou are|
|000006c0| 20 25 64 20 59 65 61 72 | 73 20 4f 6c 64 5c 6e 5c | %d Year|s Old\n\|
|000006d0| 72 22 2c 20 41 67 65 29 | 3b 0a 0a 20 20 20 20 20 |r", Age)|;.. |
|000006e0| 20 2f 2f 20 74 68 69 73 | 20 6c 6f 6f 70 20 77 69 | // this| loop wi|
|000006f0| 6c 6c 20 70 72 69 6e 74 | 20 61 20 73 69 6e 67 6c |ll print| a singl|
|00000700| 65 20 22 68 61 70 70 79 | 20 66 61 63 65 22 20 75 |e "happy| face" u|
|00000710| 6e 74 69 6c 20 58 20 3d | 3d 20 41 67 65 20 2d 20 |ntil X =|= Age - |
|00000720| 6e 6f 74 65 20 74 68 61 | 74 0a 20 20 20 20 20 20 |note tha|t. |
|00000730| 2f 2f 20 73 69 6e 63 65 | 20 58 20 73 74 61 72 74 |// since| X start|
|00000740| 73 20 61 74 20 30 2c 20 | 79 6f 75 20 64 6f 6e 27 |s at 0, |you don'|
|00000750| 74 20 77 61 6e 74 20 74 | 6f 20 70 72 69 6e 74 20 |t want t|o print |
|00000760| 77 68 65 6e 20 58 20 65 | 71 75 61 6c 73 20 41 67 |when X e|quals Ag|
|00000770| 65 2c 20 79 6f 75 20 77 | 6f 75 6c 64 0a 20 20 20 |e, you w|ould. |
|00000780| 20 20 20 2f 2f 20 68 61 | 76 65 20 6f 6e 65 20 74 | // ha|ve one t|
|00000790| 6f 6f 20 6d 61 6e 79 20 | 68 61 70 70 79 20 66 61 |oo many |happy fa|
|000007a0| 63 65 2e 0a 20 0a 20 20 | 20 20 20 20 66 6f 72 28 |ce.. . | for(|
|000007b0| 58 20 3d 20 30 3b 20 58 | 20 3c 20 41 67 65 3b 20 |X = 0; X| < Age; |
|000007c0| 58 2b 2b 29 0a 09 70 72 | 69 6e 74 66 28 22 25 63 |X++)..pr|intf("%c|
|000007d0| 22 2c 20 30 78 30 31 29 | 3b 0a 0a 20 20 20 20 20 |", 0x01)|;.. |
|000007e0| 20 2f 2f 20 74 68 69 73 | 20 70 72 69 6e 74 73 20 | // this| prints |
|000007f0| 6f 75 74 20 74 77 6f 20 | 62 6c 61 6e 6b 20 6c 69 |out two |blank li|
|00000800| 6e 65 73 0a 0a 20 20 20 | 20 20 20 70 72 69 6e 74 |nes.. | print|
|00000810| 66 28 22 5c 6e 5c 72 5c | 6e 5c 72 22 29 3b 0a 20 |f("\n\r\|n\r");. |
|00000820| 20 20 20 7d 0a 20 20 20 | 20 65 6c 73 65 20 20 20 | }. | else |
|00000830| 20 20 20 20 20 2f 2f 20 | 69 66 20 74 68 65 20 75 | // |if the u|
|00000840| 73 65 72 20 65 6e 74 65 | 72 65 64 20 30 2c 20 74 |ser ente|red 0, t|
|00000850| 68 65 6e 20 74 68 65 20 | 6f 72 69 67 69 6e 61 6c |hen the |original|
|00000860| 20 69 66 28 41 67 65 29 | 20 65 76 61 6c 75 61 74 | if(Age)| evaluat|
|00000870| 65 73 20 61 73 20 66 61 | 6c 73 65 2c 0a 20 20 20 |es as fa|lse,. |
|00000880| 20 20 20 65 78 69 74 28 | 30 29 3b 20 20 2f 2f 20 | exit(|0); // |
|00000890| 73 6f 20 65 78 69 74 20 | 74 68 65 20 70 72 6f 67 |so exit |the prog|
|000008a0| 72 61 6d 0a 20 20 7d 0a | 7d 0a 0a 52 6f 67 65 72 |ram. }.|}..Roger|
|000008b0| 20 57 2e 20 4d 69 74 63 | 68 65 6c 6c 0a 0a | W. Mitc|hell.. |
+--------+-------------------------+-------------------------+--------+--------+